package array;

import java.util.ArrayList;

public class L125 {
    public boolean isPalindrome(String s) {
        if (s.length() == 0)
            return true;
        ArrayList<Character> characters = new ArrayList<>();

        for (char c : s.toCharArray()) {
            if (c>='a' && c<='z'){
                characters.add(c);
            }
            if (c>='A' && c<='Z'){
                characters.add(Character.toLowerCase(c));

            }
            if (c>='0' && c<='9'){
                characters.add(Character.toUpperCase(c));
            }


        }
        int min=0, max=characters.size()-1;
        for(int i=min; i<=max; i++){
            if(characters.get(i)!=characters.get(max)){
                return false;
            }else {
                max-=1;
            }
        }
        return true;

    }
    public static void main(String[] args) {
        L125 l125 = new L125();
        System.out.println(l125.isPalindrome("0p"));
    }
}
